<?php


namespace App\Http\Controllers;

use App\Models\Icon;

class IndexController extends Controller
{
    // 退出
    public function logout() {
        auth()->logout();// 用户退出 清空session
        return $this->success('退出成功');
    }

    //清除缓存
    public function clear()
    {
        //Cache::flush();
        return $this->success('清除成功');
    }

    /**
     * @return \Illuminate\Http\JsonResponse
     * 所有icon图标
     */
    public function icons()
    {
        $icons = Icon::orderBy('sort', 'desc')->get();
        return response()->json(['code' => 0, 'msg' => '请求成功', 'data' => $icons]);
    }
}
